import Vue from 'vue'
import App from './App.vue'
import router from './router'
import request from "../src/utils/request";
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css'
import VueRouter from 'vue-router'
import 'amfe-flexible'
import { saveAs } from 'file-saver'
import {download} from "@/utils/request";


Vue.config.productionTip = false

Vue.use(ElementUI)
Vue.use(VueRouter)

//解决ElementUI导航栏中重复点击菜单报错问题
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}

// 全局方法挂载
Vue.prototype.download = download
Vue.prototype.saveAs = saveAs
Vue.prototype.$request = request

new Vue({
    router,
    render: h => h(App)
}).$mount('#app')
